//
//  RNOLFundsHeaderView.m
//  RongNiuOnline
//
//  Created by apple on 2018/4/16.
//  Copyright © 2018年 rongniu. All rights reserved.
//

#import "RNOLFundsHeaderView.h"

@interface RNOLFundsHeaderView()
//总金额
@property (weak, nonatomic) IBOutlet UILabel *totalMoneyLabel;

//查看按钮
@property (weak, nonatomic) IBOutlet UIButton *watchButton;
//可用余额
@property (weak, nonatomic) IBOutlet UILabel *usableLabel;
@property (weak, nonatomic) IBOutlet UILabel *leftTitleLabel;

//收益
@property (weak, nonatomic) IBOutlet UILabel *recordTypeLabel;
@property (weak, nonatomic) IBOutlet UILabel *recordIncomeLabel;

@end


@implementation RNOLFundsHeaderView

- (void)awakeFromNib{
    [super awakeFromNib];
    self.fundsRecordType = RNOLFundsListRecordTypeAll ;

}

//- (IBAction)backAction:(UIButton *)sender {
//    if (self.viewController.tabBarController.viewControllers.count == 3) {
//        [self.viewController.tabBarController.navigationController popViewControllerAnimated:YES];
//    }else{
//        [self.viewController.navigationController popViewControllerAnimated:YES];
//    }
//}

- (IBAction)watchAction:(UIButton *)sender {
    sender.selected = !sender.selected;
    [self setDisplayModeWithStatus: sender.selected];
}

//显示与否
- (void)setDisplayModeWithStatus:(BOOL)isCloseEyes{
    if (isCloseEyes) {
        self.usableLabel.text = @"****";
        self.recordIncomeLabel.text = @"****";
        self.totalMoneyLabel.text = @"恭喜发财🎉~";
    }else{
        self.usableLabel.text = @"¥666.00";
        self.recordIncomeLabel.text = @"¥233.00";
        self.totalMoneyLabel.text = @"¥5201314.00";
    }
}

- (void)setFundsRecordType:(RNOLFundsListRecordType)fundsRecordType{
    _fundsRecordType = fundsRecordType;
    switch (fundsRecordType) {
        case RNOLFundsListRecordTypeAll:
            self.recordTypeLabel.text = @"累计收益";
            self.leftTitleLabel.text = @"可用余额";
            break;
        case RNOLFundsListRecordTypeCreditC:
            self.recordTypeLabel.text = @"累计充值";
            self.leftTitleLabel.text = @"可用余额";
            break;
        case RNOLFundsListRecordTypeWithdraw:
            self.recordTypeLabel.text = @"累计提现";
            self.leftTitleLabel.text = @"可用余额";
            break;
        case RNOLFundsListRecordTypeWaitIncome:
            self.recordTypeLabel.text = @"等待收益";
            self.leftTitleLabel.text = @"累计收益";
            break;
        case RNOLFundsListRecordTypeAlreadyIncome:
            self.recordTypeLabel.text = @"待收本息";
            self.leftTitleLabel.text = @"累计收益";
            break;
        case RNOLFundsListRecordTypeAlreadyRefund:
            self.recordTypeLabel.text = @"已收本息";
            self.leftTitleLabel.text = @"累计收益";
            break;
        case RNOLFundsListRecordTypeAlreadyCommission:
            self.recordTypeLabel.text = @"已收佣金";
            self.leftTitleLabel.text = @"累计佣金";
            break;
        case RNOLFundsListRecordTypeWaitCommission:
            self.recordTypeLabel.text = @"待收佣金";
            self.leftTitleLabel.text = @"累计佣金";
            break;

        default:
            break;
    }
}


@end
